﻿@using System.Text
@model PageTopicClient

<h2>Index</h2>


<span>Topics:</span>
<div class="row-fluid">
  <div class="span10">
    <div id="divPageTopic-j" style="word-wrap:break-word;">
       <div data-bind="with: page">
            <div data-bind="foreach: models">
                <ul class="nav-stacked">
                    <li>
                        <a data-bind='text: title, attr: { href: "/topic/show/"+id() }'></a>
                        <div class="pull-right" >
                            <img data-bind='attr: {src: thumbnail}' />
                        </div>
                        <div data-bind="html: subTitle"></div>
                        <div data-bind="with: vote">
                            <i class="icon-thumbs-up" data-bind="authClick: voteUp"></i><span data-bind='text: voteUpCount'></span>
                            <i class="icon-thumbs-down" data-bind="authClick: voteDown"></i><span data-bind='text: voteDownCount'></span>
                        </div>
                        <div><span data-bind="text: userName"></span></div>
                        <div>@LocaleResources["App.PublishedBy"]<span data-bind="text: zone.toTimeDiff(lastUpdateTime())"></span></div>
                    </li>
                </ul>
            </div>
            <div data-bind="pagination:'/api/topic'"></div>
        </div>
    </div>
  </div>
  <div class="span2 pull-right">
    <button auth-required="true" auth-link="/topic/new" auth-duration="0" class="btn btn-large btn-primary">@LocaleResources["Topic.CreateTopic"]</button>
  </div>
</div>
@{
    ScriptRegister.AddJson("pageTopic", Model);
    ScriptRegister.AddKnockOutBinding("pageTopic", "#divPageTopic-j");    
}
